<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
<title>计价系统</title>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${ pageContext.request.contextPath }/css/bootstrap.min.css">

<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet" href="${ pageContext.request.contextPath }/css/bootstrap-theme.min.css">

<style type="text/css">
	body{
	padding-top:70px;
	}
</style>
</head>
<body>

	<nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">螃蟹计价系统</a>
        </div>
        
        <!-- Collect the nav links, forms, and other content for toggling -->
	    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
	      
	      <ul class="nav navbar-nav">
	        <li><a href="${ pageContext.request.contextPath }/index.jsp">首页 <span class="caret"></span></a></li>
	        
	        <li class="dropdown">
	          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">清单创建 <span class="caret"></span></a>
	          <ul class="dropdown-menu">
	            <li><a href="${ pageContext.request.contextPath }/crab_list.do?isOrder=1">收货清单</a></li>
	            <li><a href="${ pageContext.request.contextPath }/crab_list.do?isOrder=0">出货清单</a></li>
	          </ul>
	        </li>
	        
	        <li class="dropdown">
	          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">今日汇总 <span class="caret"></span></a>
	          <ul class="dropdown-menu">
	            <li><a href="${ pageContext.request.contextPath }/order_searchByDate.do?isOrder=1">收货清单</a></li>
	            <li><a href="${ pageContext.request.contextPath }/order_searchByDate.do?isOrder=0">出货清单</a></li>
	            <li role="separator" class="divider"></li>
	            <li><a href="${ pageContext.request.contextPath }/order_searchNumberByDate.do">规格比较</a></li>
	          </ul>
	        </li>
	        
	        <li class="dropdown">
	          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">清单查询 <span class="caret"></span></a>
	          <ul class="dropdown-menu">
	            <li><a href="${ pageContext.request.contextPath }/order_search.do?isOrder=1">收货清单</a></li>
	            <li><a href="${ pageContext.request.contextPath }/order_search.do?isOrder=0">出货清单</a></li>
	            <li><a href="${ pageContext.request.contextPath }/order_searchNumberByTimeUI.do">规格查询</a></li>
	          </ul>
	        </li>
	        
	      </ul>
	     
	      <ul class="nav navbar-nav navbar-right">	
	        <li class="dropdown">
	          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">用户 <span class="caret"></span></a>
	          <ul class="dropdown-menu">
	            <li><a href="${ pageContext.request.contextPath }/user_updateUI.do?userid=1">修改用户</a></li>
	          </ul>
	        </li>
	      </ul>
	    </div><!-- /.navbar-collapse -->
       
      </div>
   </nav>
    
    <s:form action="order_update">
	  <input type="hidden" name="time" value="<s:property value='#time'/>"/>
	  <input type="hidden" name="radio" value="<s:property value='#radio'/>"/>
	  <input type="hidden" name="name" value="<s:property value='#order.clientName'/>"/>
	  <input type="hidden" name="isOrder" value="<s:property value='#isOrder'/>"/>
	<div class="container" id="content">
		<div class="row-fluid">
			<div class="span12">
				<h3 class="text-center">
					<s:property value="#order.user.company"/>
				</h3>
				<br>
				<div class="col-md-2">
					客户：<s:property value="#order.clientName" />
	    		</div>
	    		<div class="col-md-8">
					No: <s:property value="#order.id" />
	    		</div>
	    		
	    		<div class="col-md-2">
					日期：<s:property value="#order.date" />
	    		</div>
	    		
	    		<br/>
	    		<br/>

					<table class="table table-bordered">
						<thead>
							<tr>
								<th>
									规格
								</th>
								<th>
									数量
								</th>
								<th>
									单价
								</th>
								<th>
									金额
								</th>
								<th>
									备注
								</th>
							</tr>
						</thead>
						<tbody>
							<s:iterator value="#order.crabList">
							<tr>
								<td>
									${name }
								</td>
								<td>
									${number }
								</td>
								<td>
									${crabPrice.price }
								</td>
								<td>
									${totalPrice }
								</td>
								<td>
									${note }
								</td>
							</tr>
							</s:iterator>
						</tbody>
					</table> 
					
					<div class="row clearfix">
						<div class="col-md-4 column">
							总计：共<s:property value="#order.totalNumber" />斤，共<s:property value="#order.totalPay" />元，均价: <s:property value="#order.meanPrice" />元/斤
						</div>
				    	<div class="col-md-4 column"></div>
				    	<div class="col-md-4 column">
				    		实际支付：<input type="text" name="realPay" value="<s:property value='#order.realPay'/>"/>
				    	</div>
				    </div>   
			   
			    	
				<br/>
				<br/>
				<div class="row clearfix">
					<div class="col-md-6 column">
						<address> 
							<s:if test="#order.user.username != null && #order.user.username != '' ">
								<strong>联系人：</strong><s:property value="#order.user.username"/>&nbsp;&nbsp;&nbsp;
							</s:if>
							<s:if test="#order.user.address != null && #order.user.address != '' ">
								<strong>地址：</strong><s:property value="#order.user.address"/>&nbsp;&nbsp;&nbsp;
							</s:if>
							<s:if test="#order.user.phone != null && #order.user.phone != '' ">
								<strong>电话：</strong><s:property value="#order.user.phone"/>
							</s:if>
						</address> 
					</div>
			    	<div class="col-md-6 column"></div>
			    </div>   	
			</div>
		</div>
		
		<div class="row clearfix">
		   	<div class="col-md-4 column"></div>
		   	<div class="col-md-4  column">
		   		<input type="submit" class="btn btn-default"  id="printbtn" value="确认修改"/>
		   		<s:if test="#radio==1">
					<a class="btn btn-default" href="order_updateUI.do?id=<s:property value='#order.id' />&time=<s:property value='#time'/>&radio=1&isOrder=<s:property value='#isOrder'/>" role="button">后退</a>
				</s:if>
				<s:elseif test="#radio==2">
					<a class="btn btn-default" href="order_updateUI.do?id=<s:property value='#order.id' />&radio=2&isOrder=<s:property value='#isOrder'/>" role="button">后退</a>
				</s:elseif>
				<s:else>
					<a class="btn btn-default" href="order_updateUI.do?id=<s:property value='#order.id' />&isOrder=<s:property value='#isOrder'/>" role="button">后退</a>
				</s:else>
		   	</div>
		   	<div class="col-md-4 column"></div>
		</div>
		
	</div>
	</s:form>
</body>
</html>
<script src="${ pageContext.request.contextPath }/js/jquery.min.js"></script>
<script src="${ pageContext.request.contextPath }/js/bootstrap.min.js"></script>
